/**
 * 
 */
package server.business;

import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.After;
import org.junit.Before;

import forum.server.controller.Security;

/**
 * @author Mirsky
 *
 */
public class SecurityTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void testHash() {
		String str1 = "abcde123";
		String str2 = "ABCDE123";
		String str3 = "abcde12";
		try {
			assertEquals(Security.encryptPassword(str1), Security.encryptPassword(str1));
			assertFalse(Security.encryptPassword(str1).equals(Security.encryptPassword(str2)));
			assertFalse(Security.encryptPassword(str1).equals(Security.encryptPassword(str3)));
		} catch (Exception e) {
			fail("Unexpected exception.");
		}
		
	}

}
